#include <iostream>

using namespace std;

int main() {
    int a = 1;
    int b = 2;
    int s = b;
    while (true) {
        int t = a + b;
        if (t > 400'0000)
            break;
        if (t % 2 == 0)
            s += t;
        a = b;
        b = t;
    }
    cout << s << endl;
}